home *** CD-ROM | disk | FTP | other *** search
- // Polyray scene file: ROTRANS.PI
- // Author: Rob McGregor
-
- // A cylinder moves over a checkered floor
-
- include "..\..\..\colors.inc"
- include "..\..\..\texture.inc"
-
- // Define the range of the animation
- start_frame 0
- end_frame 27
- total_frames 28
- outfile "cyl"
-
- // Set Up The Camera
- viewpoint {
- from <2.5, 3, -5>
- at <1.75, 0, 0>
- up <0, 1, 0>
- angle 45
- resolution 320, 200
- aspect 1.6
- }
-
- // Define the light source and background color
- light <-2, 4, -5>
- light <2, 4, -5>
- background midnight_blue
-
- // Define the cylinder "CYL"
- // By default its location is the origin
- define CYL
- object {
- cylinder <0, -0.75, 0>, <0, 0.75, 0>, 0.5
- reflective_white
- }
-
- define xPos 3.5 / total_frames * frame // the translation distance
- define zAng 90 / end_frame * frame // the rotation angle
-
- // Define a checkered floor plane
- object {
- // normal in Y direction
- polygon 4, <-1 , 0, 1>, <-1, 0, -1>, <1, 0, -1>, <1, 0, 1>
- scale <100.0, 100.0, 100.0>
- translate <0, -2.0, 0>
- texture {
- checker sapphire_agate, white_marble
- scale <0.01, 1, 0.01>
- }
- }
-
- // Now we translate CYL 3.5 units along the x-axis
- // and rotate it 90 degrees on the z-axis.
- // This takes place over 28 frames...
- object {
- CYL
- translate <0, 0, 0> // CYL moves to origin for rotation
- rotate <0, 0, zAng> // CYL rotates zAng each frame
- translate <xPos, 0, 0> // CYL moves to xPos each frame
- }
-